﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Master.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<OnlineMovieTicket.Model.Movies>>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"></asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
        <table cellpadding="0" cellspacing="0"  class="pageBackGround">
                            <tr height="10px"></tr>
                            <tr><td class="fontWhite">
                                <table bgcolor="white" >                 
                                    <tr><td>                
                                        <table cellpadding="6" cellspacing="6" height="100%" class="pageBackGround" width="975px">
                                            <tr><td class="fontWhiteBold"><h2>Movies</h2></td></tr>
                                            <tr><td>
                                                    <table id="trGrid" width="940px">
                                                            <tr bgcolor="white">
                                                                <td id="tdHeaderGrid">   
                                                                <td id="tdHeaderGrid">  
                                                                    <b>Movie Code</b>
                                                                </td>
                                                                 <td id="tdHeaderGrid">
                                                                     <b>Movie Name</b>
                                                                </td>
                                                               <td id="tdHeaderGrid">
                                                                     <b>Languages</b>
                                                                </td>
                                                               <td id="tdHeaderGrid">
                                                                     <b>Duration(Minutes)</b>
                                                                </td>
                                                               <td id="tdHeaderGrid">
                                                                     <b>Release Date</b>
                                                                </td>
                                                                <td id="tdHeaderGrid">
                                                                     <b>Genre</b>
                                                                </td>   
                                                                <td id="tdHeaderGrid">
                                                                     <b>Movie Cast</b>
                                                                </td>
                                                                <%--<td id="tdHeaderGrid">
                                                                     <b>Movie Director</b>
                                                                </td> --%>                                                
                                                                <td id="tdHeaderGrid">
                                                                     <b>Status</b>
                                                                </td>                                                  
                                                            </tr>

                                                        <% foreach (var item in Model) { %>
    
                                                            <tr id="trGrid">
                                                                 <td id="tdBodyGrid">
                                                                    <%: Html.ActionLink("Edit", "Edit", new {  id=item.MovieCode  }) %> |
                                                                    <%: Html.ActionLink("Delete", "Delete", new { id=item.MovieCode }, new { onclick = "return confirm('Do you really want to delete this moovie?')" })%>
                                                                </td>
                                                                <td id="tdBodyGrid">
                                                                    <%: item.MovieCode %>
                                                                </td>
                                                                 <td id="tdBodyGrid">
                                                                    <%: item.MovieName %>
                                                                </td>
                                                                 <td id="tdBodyGrid">
                                                                    <%: item.Language %>
                                                                </td>
                                                                <td id="tdBodyGrid">
                                                                    <%: String.Format("{0:g}", item.Duration) %>
                                                                </td>
                                                                 <td id="tdBodyGrid">
                                                                    <%= String.Format("{0:dd MMM yyyy}", item.ReleaseDate) %>
                                                                </td>
                                                                <td id="tdBodyGrid">
                                                                    <%: item.Genre %>
                                                                </td>                                                             
                                                                <td id="tdBodyGrid">
                                                                    <%: item.MovieCast %>
                                                                </td>
                                                                <%--<td id="tdBodyGrid">
                                                                    <%: item.MovieDirector %>
                                                                </td>             --%>                                                 
                                                                <td id="tdBodyGrid">
                                                                <% if (item.Status == "N")
                                                                   { %>
                                                                    <%: "Now Showing"%>
                                                                <% } %>
                                                                <% if (item.Status == "C")
                                                                   { %>
                                                                    <%: "Comming Soon"%>
                                                                <% } %>
                                                                <% if (item.Status == "P")
                                                                   { %>
                                                                    <%: "Past"%>
                                                                <% } %>

                                                                </td>                                                              
                                                            </tr>
    
                                                        <% } %>
                                                    </table>            
                                                </td></tr>
                                                 <tr><td height="10px"> <%: Html.ActionLink("Create New", "Create") %></td></tr>
                                            </table>    
                                        </td></tr>                                       
                              </table>
                        </td></tr>
                        <tr><td height="10"></td></tr>                                    
        </table>

</asp:Content>

